package algorithm.lanqiao.t99;


import java.io.*;



public class Main {
    public static void main(String[] args) {
        int n = IOUtil.readInt(), k = IOUtil.readInt();
        int[] h = new int[n+1], w = new int[n+1];
        int maxl = 0;
        for(int i = 1; i <= n; i ++) {
            h[i] = IOUtil.readInt();
            w[i] = IOUtil.readInt();
            maxl = Math.max(maxl, h[i]);
            maxl = Math.max(maxl, w[i]);
        }
        int l = 1, r = maxl, mid = 0;
        while(l < r) {
            mid = (l+r+1)/2;
            if(check(h,w,mid,k)) {
                l = mid;
            }else {
                r = mid-1;
            }
        }
        IOUtil.out.println(l);
        IOUtil.out.flush();
    }

    private static boolean check(int[] h, int[] w, int mid, int k) {
        int len = h.length - 1;
        int num = 0;
        for(int i = 1; i <= len; i ++) {
            if(h[i] >= mid && w[i] >= mid) {
                num += (h[i]/mid) * (w[i]/mid);
            }
        }
        return num >= k;
    }
    static class IOUtil {
        // 读
        static InputStreamReader ins = new InputStreamReader(System.in);
        static StreamTokenizer in = new StreamTokenizer(ins);
        static BufferedReader br = new BufferedReader(ins);

        // 写
        public static PrintWriter out = new PrintWriter(System.out);


        public static int readInt() {
            try {
                in.nextToken();
            }catch (Exception e) {
                e.printStackTrace();
            }
            return (int) in.nval;
        }

        public static String readLine() {
            String str = "";
            try {
                str =  br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}
